package com.biwin.module.org.api.dto;

import com.biwin.common.api.annotations.ValidUpdate;
import com.biwin.common.app.dto.BasicBwDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * System User 入参对象
 *
 * @author biwin
 * @since 0.0.1
 */
@ApiModel(value = "系统用户 - SystemUserDto",
        description = "新增或修改系统用户的前端传参模型")
public class SystemUserDto extends BasicBwDto {

    private static final long serialVersionUID = 4258788221111336211L;

    /**
     * 登录账号
     */
    @ApiModelProperty("登录账号")
    @NotBlank(message = "登录账号不能为空")
    @Length(min = 5, max = 15, message = "登录账号长度必须在5-15位之间")
    private String account;

    /**
     * 性别
     */
    @ApiModelProperty("性别")
    @NotNull(message = "性别不能为空")
    private Integer sex;

    /**
     * 姓名
     */
    @ApiModelProperty("性名")
    @NotBlank(message = "姓名不能为空")
    private String name;

    /**
     * 密码
     */
    @ApiModelProperty("密码")
    @NotBlank(message = "密码不能为空")
    private String password;


    /**
     * 密码试错次数
     */
    @ApiModelProperty(value = "密码试错次数", hidden = true)
    private Integer passwordFaultNum = 0;

    /**
     * 密码最后修改时间
     */
    @ApiModelProperty(value = "密码最后修改时间", hidden = true)
    private Date passwordLastModifyDate;

    /**
     * 上次登录时间
     */
    @ApiModelProperty(value = "上次登录时间", hidden = true)
    private Date lastLoginDate;

    /**
     * 账户是否锁定
     */
    @ApiModelProperty("账户是否锁定")
    @NotNull(message = "账户是否锁定")
    private Boolean locked = false;

    /**
     * 账户是否有效
     */
    @ApiModelProperty("账户是否锁定")
    @NotNull(message = "账户是否有效")
    private Boolean effective = true;

    /**
     * 联系电话
     */
    @ApiModelProperty("联系电话")
    @Length(min = 8, max = 11, message = "联系电话至少8位")
    private String tel;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getPasswordFaultNum() {
        return passwordFaultNum;
    }

    public void setPasswordFaultNum(Integer passwordFaultNum) {
        this.passwordFaultNum = passwordFaultNum;
    }

    public Date getPasswordLastModifyDate() {
        return passwordLastModifyDate;
    }

    public void setPasswordLastModifyDate(Date passwordLastModifyDate) {
        this.passwordLastModifyDate = passwordLastModifyDate;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public Boolean getLocked() {
        return locked;
    }

    public void setLocked(Boolean locked) {
        this.locked = locked;
    }

    public Boolean getEffective() {
        return effective;
    }

    public void setEffective(Boolean effective) {
        this.effective = effective;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

}
